<template>
  <div>
    <div class="header">
      <img src="../assets/images/fanhui.png" height="23" alt="" @click="back" />
      <div>拜访记录</div>
      <div @click="btn">新增</div>
    </div>
    <div class="search">
      <van-search show-action placeholder="关键字查询">
        <template #action>
          <div style="color: #1f3695">搜索</div>
        </template>
      </van-search>
    </div>
    <div class="conList" v-for="item in records" :key="item.id" @click="onFN(item.id)">
      <div class="list">
        <img src="../assets/images/旗下企业-头像.png" width="70" alt="" />
        <div class="list-center">
          <div style="color:#000">拜访标题:{{item.visitTitle}}</div>
          <div>客户名称:{{item.custName}}</div>
          <div>拜访时间:{{item.visitTime}}</div>
        </div>
        <div class="box-max">
            <div class="box-min">定期回访</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {visit} from '../request/api'
export default {
  data() {
    return {
      records:[]
    };
  },
  methods: {
    back() {
      this.$router.back();
    },
    btn(){
      this.$router.push('/visitXZ/')
    },
    onFN(id){
      this.$router.push('/visitXQ/'+id)
    }
  },
  created(){
      visit({
          current:1,
          size:10
      }).then(res=>{
          if(res.errCode==0){
              let {records} = res.data
              this.records=records
          }
      })
  }
};
</script>
 
<style lang = "less" scoped>
.box-max{
    position: relative;
    width: 50px;
    height: 70px;
    .box-min{
    position: absolute;
    top: 0;
    width: 50px;
    height: 20px;
    font-size: 12px;
    color: gold;
    border: 1px solid gold;
}

}

.conList {
  background: #fff;
  padding: 10px;
  padding-right: 20px;
  .list {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px dashed #999;
    .list-center {
      color: #999;
      font-size: 12px;
      width: 70%;
      div {
        line-height: 25px;
      }
    }
  }
}
* {
  padding: 0;
  margin: 0;
}
.header {
  width: 100vw;
  height: 64px;
  background: #003399;
  display: flex;
  justify-content: space-around;
  color: #fff;
  font-size: 22px;
  padding: 25px 10px;
  box-sizing: border-box;
}
.search {
  padding: 8px;
  box-sizing: border-box;
  background: #fff;
  border-bottom: 1px solid #e4e4e4;
  margin-bottom: 10px;
}
.van-search__content {
  border-radius: 20px;
}
</style>